@page
@using EasyAbp.WeChatManagement.MiniPrograms.Permissions
@using EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram
@using EasyAbp.WeChatManagement.MiniPrograms.Localization
@using EasyAbp.WeChatManagement.MiniPrograms.Web.Menus
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@model IndexModel
@inject IPageLayout PageLayout
@inject IHtmlLocalizer<MiniProgramsResource> L
@inject IAuthorizationService Authorization
@{
    PageLayout.Content.Title = L["MiniProgram"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:MiniProgram"].Value);
    PageLayout.Content.MenuItemName = MiniProgramsMenus.MiniProgram;
}

@section scripts
{
    <abp-script src="/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/index.js" />
}
@section styles
{
    <abp-style src="/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/index.css"/>
}

<abp-card>
    <abp-card-header>
        <abp-row>
            <abp-column size-md="_6">
                <abp-card-title>@L["MiniProgram"]</abp-card-title>
            </abp-column>
            <abp-column size-md="_6" class="text-right">
			    @if (await Authorization.IsGrantedAsync(MiniProgramsPermissions.MiniProgram.Create))
                { 
                <abp-button id="NewMiniProgramButton"
                            text="@L["CreateMiniProgram"].Value"
                            icon="plus"
                            button-type="Primary" />
                }
            </abp-column>
        </abp-row>
    </abp-card-header>
    <abp-card-body>
        <abp-table striped-rows="true" id="MiniProgramTable" class="nowrap">
            <thead>
            <tr>
                <th>@L["Actions"]</th>
                <th>@L["MiniProgramWeChatComponentId"]</th>
                <th>@L["MiniProgramName"]</th>
                <th>@L["MiniProgramDisplayName"]</th>
                <th>@L["MiniProgramOpenAppIdOrName"]</th>
                <th>@L["MiniProgramAppId"]</th>
                <th>@L["MiniProgramAppSecret"]</th>
                <th>@L["MiniProgramToken"]</th>
                <th>@L["MiniProgramEncodingAesKey"]</th>
                <th>@L["MiniProgramIsStatic"]</th>
            </tr>
            </thead>
        </abp-table>
    </abp-card-body>
</abp-card>